﻿using System;
using System.Xml;
using Soveryn.Commerce.BaseClasses;
using Soveryn.Commerce.Shared;

namespace Soveryn.Commerce.Doodads
{

    public partial class Breadcrumbs : DoodadBaseClass
    {

        new protected void Page_Load(object sender, EventArgs e)
        {

            base.Page_Load(sender, e);

            if (IsPostBack)
                return;

            for (int i = 0; i < ParentMasterPage.PageTrail.Count;i++)
            {
                PageProperties page = (PageProperties)ParentMasterPage.PageTrail[i];

                if (page.PageID == ParentPage.Properties.PageID)
                    CrumbsHTMLLiteral.Text = "<a class='current' href='" + page.SEO.GetURL(ParentPage) + "'>" + page.SEO.MenuLinkText + "</a>" +  CrumbsHTMLLiteral.Text;
                else
                    CrumbsHTMLLiteral.Text = "<a href='" + page.SEO.GetURL(ParentPage) + "'>" + page.SEO.MenuLinkText + "</a>" + "&raquo;" + CrumbsHTMLLiteral.Text;

            }

        }

    }
}
